package com.stone.common.util;

import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.math.RandomUtils;

/**
 * 随机数帮助类
 * @author Stone P
 *
 */
public class RandomUtil {
	/**
	 * 生成16为随机数
	 * 生成规则：当前时间+随机数+3位字符串
	 * @return
	 */
	public static String getRandom16(){
		long time = System.currentTimeMillis();
		int randomInt = RandomUtils.nextInt(100000);
		long radomNum = time + (long) randomInt;
		String randomStr = radomNum + RandomStringUtils.randomNumeric(3);
		return randomStr;
	}
}
